package com.comac.print.component.app.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 模板维护表
 * </p>
 *
 * @author zhoubin
 * @since 2025-04-16 03:51:14
 */
@Getter
@Setter
@TableName("print_masterplate")
@ApiModel(value = "PrintMasterplate对象", description = "模板信息表")
public class PrintMasterplate extends Model<PrintMasterplate> {

    @ApiModelProperty("模板id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("模板名称")
    @TableField("system_id")
    @NotBlank
    private String systemId;

    @ApiModelProperty("模板编号")
    @TableField("bussiness_id")
    @NotBlank
    private String bussinessId;

    @ApiModelProperty("模板版本")
    @TableField("version")
    private String version;

    @ApiModelProperty("从哪一个模板升版")
    @TableField("from_version")
    private String fromVersion;

    @ApiModelProperty("模板生效开始")
    @TableField("valid_start")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date validStart;

    @ApiModelProperty("模板生效结束")
    @TableField("valid_end")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date validEnd;

    @ApiModelProperty("模板url")
    @TableField("mp_url")
    private String mpUrl;

    @ApiModelProperty("操作人（工号）")
    @TableField("operator")
    private String operator;

    @ApiModelProperty("操作人名字")
    @TableField("operator_name")
    private String operatorName;

    @ApiModelProperty("操作时间")
    @TableField("operator_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date operatorTime;

    @ApiModelProperty("是否删除")
    @TableField("delete_flag")
    @TableLogic
    private Boolean deleteFlag = false;

    @Override
    public Serializable pkVal() {
        return this.id;
    }
}
